package su.samcom.calc.model.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: Владислав
 * Date: 19.11.13
 * Time: 23:25
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "calc_samcom_su.location")
public class Location implements Serializable {
    private static final long serialVersionUID = 6976490260420179L;

    private Long id;
    private String name;
    private Country country;

    @Id
    @SequenceGenerator(name = "location_gen", sequenceName = "calc_samcom_su.location_seq", allocationSize = 1)
    @GeneratedValue(generator = "location_gen", strategy = GenerationType.SEQUENCE)
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "country_id")
    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }
}
